<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<script type="text/javascript" src="../../inc/ctx.jsp"></script>
<script type="text/javascript" src="../js/g.js"></script>
<script type="text/javascript" src="http://cdn.uuola.cn/js/dtree.js"></script>
<link href="http://cdn.uuola.cn/css/dtree.css" type="text/css" rel="stylesheet"/>
<link href="../css/com.css" type="text/css" rel="stylesheet"/>
<style>
    #panel{width:90%;}
    .dree a{font-size:12px;}
</style>
</head>
<body>

<div id="panel">
<form id="add_cat_frm" name="add_cat_frm">
  <table>
    <tr>
      <td width="27%" class="r">信息类别权限指派：</td>
      <td width="59%">
<div id="ctree" class="dree"></div>
<script type="text/javascript" language="javascript">
var ctree={
init:function(){
$.get('../app/catalogs/list_factor.shtm?colfilter=y&all=y&t='+ut.r(),function(r){
var x = r.list;
var len = x.length;
var s='';
dt = new dTree('dt');
dt.add(0,-1,'栏目类别(分配子类权限必须关联分配父类权限)');
if(len>0){
for(var k=0; k<len; k++){
s='<input type="checkbox" value="@cid" name="cids" />'.replace(/@cid/,x[k].cid); 
dt.add(x[k].cid, x[k].rid, '['+x[k].cid+']'+x[k].cname+s, "#info");
}
$('#ctree').html(dt.toString());
}
});
}
         };
 ctree.init();
</script>
          
      </td>
      <td width="14%"><input type="button" value="反选" onclick="ut.swapsel('cids');"/></td>
    </tr>
    <tr>
      <td>&nbsp;</td>
      <td class="c"><input name="submitBtn" type="button" class="button medium orange" id="submitBtn" tabindex="7" value="更新指派" onClick="MEC.submit();" />
    <input name="backBtn" type="button" class="button medium gray" id="backBtn" tabindex="7" value="返回" onclick="ut.reload('mgr.html?'+ut.r());" />
      </td>
      <td>&nbsp;</td>
      </tr>
</table>
 </form>
</div>

    
    
<script type="text/javascript">
var mid = ut.get('mgrid');
var page = ut.get('page');
var MEC={
init:function(){
$.get('../app/admin/query_mgr_cids.shtm','t='+ut.r()+'&mgrid='+mid,function(d){
var x = $.trim(d);
if(x=='0')return;
x=[',',x,','].join('');
$("input[name='cids']").each(function(){
if(x.indexOf(','+$(this).val()+',')>=0)$(this).attr('checked','true');
});
});
},
submit:function(){
var p={cids:'',mgrid:mid,t:ut.r()}; p.cids=ut.getselv('cids').replace(/\-/g,',');
var $rb=$('#submitBtn');
var u=$.param(p);
$rb.attr('disabled','disabled');
$.get('../app/admin/update_mgr_cids.shtm', u, function(x){
    var r =  $.trim(x) ;
    if(r=='ok'){
        ut.m('成功修改管理信息类别指派.');
    }else {
        ut.m('处理遇到错误. '+r);
    }
    ut.reload('mgr.html?'+ut.r());
});
}
};
ut.delay(MEC.init);
</script>
</body>
</html>
